package cn.technology.forum.service;

import cn.technology.forum.dto.*;
import cn.technology.forum.enums.CommentTypeEnum;
import cn.technology.forum.enums.NotificationStatusEnum;
import cn.technology.forum.enums.NotificationTypeEnum;
import cn.technology.forum.exception.CustomizeErrorCode;
import cn.technology.forum.exception.CustomizeException;
import cn.technology.forum.mapper.*;
import cn.technology.forum.model.*;
import cn.technology.forum.util.TimeUtils;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

@Service
public interface CommentService {


    Integer[] getRMaxs();
    void insert(Comment comment, UserDTO commentator,UserAccount userAccount);

    Question updateQuestionAfterComment(Long questionId);

    void updateUserAccoundByUserId(Long userId);

    void createNotify(Comment comment, Long receiver, String notifierName, String outerTitle, NotificationTypeEnum notificationType, Long outerId);

    List<CommentDTO> listByTargetId(Long id, CommentTypeEnum type);

    int delCommentByIdAndType(Long userId, Integer groupId, Long id, Integer type);


    int deleteByIdAndType(UserDTO userDTO, Long id, Integer type);

    PaginationDTO list(CommentQueryDTO commentQueryDTO);

    void insert(CommentDTO commentDTO, UserDTO userDTO);
}
